package com.hg.design.behavior.iterator.biancheng.ex2;

import java.util.ArrayList;
import java.util.List;

//具体聚合：婺源景点集
public class WyViewSpotSet implements ViewSpotSet {
    private ArrayList<WyViewSpot> list = new ArrayList<>();

    @Override
    public void add(WyViewSpot wyViewSpot) {
        this.list.add(wyViewSpot);
    }

    @Override
    public void remove(WyViewSpot wyViewSpot) {
        this.list.remove(wyViewSpot);
    }

    @Override
    public ViewSpotIterator getIterator() {
        return new WyViewSpotIterator(this.list);
    }
}
